#ifndef __MV_PUB_H__
#define __MV_PUB_H__

#ifndef __cplusplus
#  error core.hpp header must be compiled as C++
#endif
#include <opencv2/opencv.hpp>
using namespace cv;

class MvPub {
public:
	// 绘制交叉线十字线
	void drawXLine(Mat& src, Point2f &pt, Scalar sclr, int width, int len);

	// 生成十字模板
	void makeTemp7x7Strong(OutputArray temp);
	void makeTemp7x7StrongInv(OutputArray temp);

	Mat makeTempX(int x, int y); // 十字数1，背景为0
	Mat makeInvTempX(int x, int y);

	// 查找十字交叉线中心座标
	int findCrossPoints(Mat &src, OutputArray pts);

	// 通过圆心，半径，源座标求投影座标
	// x0,y0:圆心座标；u,v:投影座标
	float getCircleMapSrcX(int u, int v, float x0, float y0, float r);
	float getCircleMapSrcY(int u, int v, float x0, float y0, float r);
	Point2f getCircleMapSrcPoint(int u, int v, float x0, float y0, float r);
	void getCircleMapSrcPic(Mat &dst, Mat &src, int r);
	void getCircleMapSrcPic(Mat &dst, Mat &src, float calCurv[], int calCurvNum);



	float getPointR(Point2f xy, Point2f dstPoint);
	float getLinearInsert(float calCurv[], float x);
};

#endif
